package com.fly.estore.framework.session;

import com.fly.estore.domain.AccountInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Fly on 2016/3/25.
 */
public interface SessionManager {

    /**
     * 创建账号session
     * @param request
     * @param accountInfo   账号对象
     * @return 返回sessionId
     */
    public String createAccountSession(HttpServletRequest request, AccountInfo accountInfo);

    /**
     * 更新账号session
     * @param request
     * @param sessionId sessionId
     * @return 返回AccountSession对象
     */
    public AccountSession updateAccountSession(HttpServletRequest request, String sessionId);

    /**
     * 获取账号session
     * @param request
     * @param sessionId
     * @return
     */
    public AccountSession getAccountSession(HttpServletRequest request, String sessionId);

    /**
     * 删除账号session
     * @param request
     * @param sessionId sessionId
     */
    public void removeAccountSession(HttpServletRequest request, String sessionId);

}
